﻿<UserControl x:Class="LiSAClient.WpfClient.View.Projects.NewProject_Step7"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="700">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width ="*"/>
            <ColumnDefinition Width="300"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!--Caption-->
        <Label Grid.Column="0" Grid.Row="0" Content="Project Members" Style="{StaticResource PageCaption}"/>

        <!--Dispaly added criteria-->
        <DataGrid Grid.Column="0" Grid.Row="1" Name="CriteriaDataGrid" ItemsSource="{Binding Project.Users}"  Style="{StaticResource DataGridStyle}"
                      AutoGenerateColumns="False" IsReadOnly="True" IsSynchronizedWithCurrentItem="True" SelectionMode="Single" SelectionUnit="FullRow" 
                     SelectedItem="{Binding SelectedUser, Mode=TwoWay}">
            <DataGrid.Columns>
                <DataGridTextColumn MinWidth="150" HeaderStyle="{StaticResource DgchStyle}" Binding="{Binding FullName}" Header="Name" ElementStyle="{StaticResource DataGridTextColumnElementStyle}" />
                <DataGridTextColumn MinWidth="200" HeaderStyle="{StaticResource DgchStyle}" Binding="{Binding Email}" Header="E-mail" ElementStyle="{StaticResource DataGridTextColumnElementStyle}"/>
                <DataGridTextColumn MinWidth="150" HeaderStyle="{StaticResource DgchStyle}" Binding="{Binding Organization.Name}" Header="Organization" ElementStyle="{StaticResource DataGridTextColumnElementStyle}"/>
            </DataGrid.Columns>
            <!--<DataGrid.InputBindings>
                <MouseBinding Gesture="LeftDoubleClick" Command="{Binding ShowSelection}"/>
            </DataGrid.InputBindings>-->
        </DataGrid>

        <!--Allow new criteria-->
        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>


            <!--Title-->
            <Label Grid.Column="0" Grid.Row="0" Content="Add user" Style="{StaticResource InformationCaption}"/>
            <ComboBox Grid.Column="1" Grid.Row="0" ItemsSource="{Binding UsersInSystem}" SelectedItem="{Binding SelectedUser}" DisplayMemberPath="FullName" SelectedValuePath="FullName" TabIndex="0"/>

            <!--SubmitButton-->
            <Button Grid.Row="1" Grid.Column="1" Name="ButtonNewMember" Style="{StaticResource LoginBoxButtonStyle}" Command="{Binding AddUser}" TabIndex="2" Content="Add member" IsDefault="True"/>
        </Grid>

        <!--Display navigation buttons-->
        <Button Grid.Row="3" Grid.Column="0" Name="ButtonPrevious" Style="{StaticResource LoginBoxButtonStyle}" Command="{Binding PreviousStep}" TabIndex="5" Content="Previous" HorizontalAlignment="Left"/>
    </Grid>
</UserControl>
